// types/delivery.ts
export interface DeliveryOrder {
  orderInfo: {
    platformOrderId: string
    amount: number
    orderDate: string
    status: 'pending' | 'paid' | 'shipped' | 'completed' | 'cancelled'
  }
  customerInfo: {
    name: string
    contactPerson?: string
    phone?: string
    email?: string
    address?: string
  }
  logisticsInfo?: {
    company: string
    trackingNumber: string
    deliveryDate?: string
    estimatedArrivalDate?: string
    actualArrivalDate?: string
    status: 'pending' | 'shipped' | 'in_transit' | 'delivered' | 'exception'
  }
  aiSuggestion?: {
    content: string
    confidence: number
    level: 'high' | 'medium' | 'low'
    suggestedAction: string
    bestDeliveryTime: string
  }
  batchOrders?: DeliveryOrder[] // 用于批量操作
}

export interface DeliveryRecord {
  orderInfo: {
    platformOrderId: string
    amount: number
    orderDate: string
  }
  customerInfo: {
    name: string
    contactPerson?: string
    phone?: string
    email?: string
    address?: string
  }
  logisticsInfo: {
    deliveryId: string
    company: string
    trackingNumber: string
    deliveryDate: string
    estimatedArrivalDate?: string
    actualArrivalDate?: string
    status: 'pending' | 'shipped' | 'in_transit' | 'delivered' | 'exception'
    operator: string
    notes?: string
    isBatch: boolean
  }
  deliveryHistory: {
    timestamp: string
    status: string
    location?: string
    remarks?: string
  }[]
}

export interface DeliveryQueryParams {
  page: number
  limit: number
  orderStatus?: string
  logisticsStatus?: string
  customerName?: string
  deliveryDateRange?: string[]
  logisticsCompany?: string
  trackingNumber?: string
}